package org.deschutter.hibernate;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:39:29
 */
public class PlanetsPK implements Serializable {
    private String planetname;

    @Column(name = "planetname")
    @Id
    public String getPlanetname() {
        return planetname;
    }

    public void setPlanetname(String planetname) {
        this.planetname = planetname;
    }

    private String rulername;

    @Column(name = "rulername")
    @Id
    public String getRulername() {
        return rulername;
    }

    public void setRulername(String rulername) {
        this.rulername = rulername;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PlanetsPK planetsPK = (PlanetsPK) o;

        if (planetname != null ? !planetname.equals(planetsPK.planetname) : planetsPK.planetname != null) return false;
        if (rulername != null ? !rulername.equals(planetsPK.rulername) : planetsPK.rulername != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = planetname != null ? planetname.hashCode() : 0;
        result = 31 * result + (rulername != null ? rulername.hashCode() : 0);
        return result;
    }
}
